package site.edody.dframe.websocket;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * WebSocket服务器启动监听器
 * @author Dody
 */
@Component
public class DFrameWebSocketStartupListener implements ApplicationListener<ApplicationReadyEvent> {

    private static final Logger log = LoggerFactory.getLogger(DFrameWebSocketStartupListener.class);

    @Autowired
    private DFrameWebSocketManager serverManager;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        log.info("DFrame WebSocket servers initialized. Total servers: {}", serverManager.getServerCount());
    }
}